package com.itheima;

import org.apache.log4j.BasicConfigurator;
import org.apache.log4j.Logger;
import org.apache.log4j.helpers.LogLog;
import org.junit.Test;

public class Log4jTest {


    @Test
    public void testQuick() {

        Logger logger = Logger.getLogger(Log4jTest.class);
        //开启log4j 内置日志记录
//        LogLog.setInternalDebugging(true);

        //初始化配置信息，暂不使用配置文件
//        BasicConfigurator.configure();
        //获取日志记录器对象
        logger.info("hello log4j");
        //日志级别
        logger.fatal("fatal");
        logger.error("error");
        logger.warn("warn");
        logger.info("info");
        logger.debug("debug");
        logger.trace("trace");
        Logger logger1 = Logger.getLogger(Logger.class);
        System.out.println("---------------");
        logger1.fatal("fatal");
        logger1.error("error");
        logger1.warn("warn");
        logger1.info("info");
        logger1.debug("debug");
    }
}
